package chapter09.exercise.interfaces.nesting;

public class A {
    interface B {
        void f();
    }

    public class Bimp implements B {
        public void f() {
        }
    }

    private class Bimp2 implements B {
        public void f() {
        }
    }

    public interface C {
        void f();
    }

    public class Cimp implements C {
        public void f() {
        }
    }

    private class Cimp2 implements C {
        public void f() {
        }
    }

    private interface D {
        void f();
    }

    public class Dimp implements D {
        public void f() {
        }
    }

    public class Dimp2 implements D {
        public void f() {
            System.out.println("Dimp2 f()");
        }
    }

    public D getD() {
        return new Dimp2();
    }

    private D dRef;

    public void receiveD(D d) {
        dRef = d;
        dRef.f();
    }
}
